home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / tcsh / dist / Imakefile < prev    next >
Encoding:
Makefile  |  1991-12-21  |  8.7 KB  |  411 lines

  1. /**/#
  2. /**/# $Id: Imakefile,v 1.5 1991/11/26 04:28:26 christos Exp $
  3. /**/#
  4. /**/# Imakefile for for tcsh 6.00
  5. /**/# Marc Horowitz, MIT SIPB
  6. /**/#
  7.  
  8. #ifdef DestDir
  9. #undef DestDir
  10. #endif
  11.  
  12. /* All config options go in a separate file. */
  13.  
  14. #include "imake.config"
  15.  
  16. /* This is a giant conditional block.  It should be set up right for
  17. platforms which are in here, but it may need to be changed for new
  18. ones.  Please send in your fixes and additions! */
  19.  
  20. /**** tcsh configuration defines ****/
  21.  
  22. /* specific platforms */
  23.  
  24. #ifdef UltrixArchitecture
  25. #define ConfigH ultrix
  26. #endif
  27.  
  28. #if defined(VaxArchitecture) && !defined(UltrixArchitecture)
  29. #define ConfigH bsd
  30. #endif
  31.  
  32. #ifdef NeXTArchitecture
  33. #define ConfigH next
  34. #endif
  35.  
  36. #if defined(SunArchitecture)
  37. # if (OSMajorVersion == 3)
  38. #  define ConfigH sunos3
  39. # else /* OSMajorVersion == 4 */
  40. #  if (OSMinorVersion == 0)
  41. #   define ConfigH sunos40
  42. #  else /* OSMinorVersion == 1 */
  43. #   define ConfigH sunos41
  44. #  endif
  45. # endif
  46. #endif
  47.  
  48. #ifdef HPArchitecture
  49. #define ConfigH hpux
  50. #endif
  51.  
  52. #ifdef CrayArchitecture
  53. #define ConfigH cray
  54. #endif
  55.  
  56. #ifdef SGIArchitecture
  57. #define ConfigH sgi
  58. #endif
  59.  
  60. #ifdef IBMArchitecture
  61. # if (SystemV == YES)
  62. #  define ConfigH aix
  63. # else
  64. #  define ConfigH bsd
  65. #  define AOSArchitecture
  66. # endif
  67. #endif
  68.  
  69. #if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
  70. #define ConfigH mips
  71. #endif
  72.  
  73. #ifdef DguxArchitecture
  74. #define ConfigH dgux
  75. #endif
  76.  
  77. #ifdef ConvexArchitecture
  78. #define ConfigH convex
  79. #endif
  80.  
  81. #ifdef SQNTArchitecture
  82. #define ConfigH sequent
  83. #endif
  84.  
  85. /* generic os's */
  86.  
  87. #ifndef ConfigH
  88.  
  89. #if (SystemV == YES)
  90. #define ConfigH sysv3
  91. #else
  92. /* why this as a default?  Why not? */
  93. #define ConfigH bsd
  94. #endif
  95.  
  96. #endif /* !ConfigH */
  97.  
  98. /*
  99.  * Concat3 - concatenates three strings.
  100.  */
  101. #ifndef Concat3
  102. # if defined(__STDC__) && !defined(UnixCpp)
  103. #  define XConcat3(a,b,c) a##b##c
  104. #  define Concat3(a,b,c) XConcat3(a,b,c)
  105. # else
  106. #  define Concat3(a,b,c) a/**/b/**/c
  107. # endif
  108. #endif
  109.  
  110. CONFIGH = Concat3(-DCONFIGH=\"config/config.,ConfigH,\")
  111.  
  112. #ifdef TcshPath
  113. TCSHPATH = Concat3(-D_PATH_TCSHELL=\",TcshPath,\")
  114. #else
  115. TCSHPATH =
  116. #endif
  117.  
  118. /**** libraries ****/
  119.  
  120. #if (SystemV == NO) || defined(HPArchitecture) || defined(SQNTArchitecture) || \
  121.     defined(MacIIArchitecture) || defined(UseLibTermcap)
  122. LIBTERMCAP = -ltermcap
  123. #else
  124. LIBTERMCAP =
  125. #endif
  126.  
  127. #if defined(SQNTArchitecture)
  128. LIBSQNT=-lseq
  129. #endif
  130.  
  131. /* This may not be good enough - I don't have access to enough systems
  132. to really test it. */
  133. #if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
  134. LIBCURSES = -lcurses
  135. #else
  136. LIBCURSES =
  137. #endif
  138.  
  139. #if defined(UseLibNet)
  140. LIBNET = -lnet
  141. #else
  142. LIBNET =
  143. #endif
  144.  
  145. #if defined(UseLibSocket)
  146. LIBSOCKET = -lsocket
  147. #else
  148. LIBSOCKET =
  149. #endif
  150.  
  151. #if defined(SGIArchitecture) || defined(_IBMR2) || \
  152.     (!defined(RtArchitecture) && defined(AIXArchitecture)) || \
  153.     defined(UseLibBSD)
  154. LIBBSD = -lbsd
  155. #else
  156. LIBBSD = 
  157. #endif
  158.  
  159. #if (defined(SGIArchitecture) && \
  160.      (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
  161.     defined(UseLibC_S)
  162. LIBC_S = -lc_s
  163. #else
  164. LIBC_S =
  165. #endif
  166.  
  167. #if defined(UseLibSun)
  168. LIBSUN = -lsun
  169. #else
  170. LIBSUN =
  171. #endif
  172.  
  173. #if defined(UseLibCposix)
  174. LIBCPOSIX = -lcposix
  175. #else
  176. LIBCPOSIX =
  177. #endif
  178.  
  179. #if defined(UseLibInet)
  180. LIBINET = -linet
  181. #else
  182. LIBINET =
  183. #endif
  184.  
  185. #if defined(UseLibDir)
  186. LIBDIR = -ldir
  187. #else
  188. LIBDIR = 
  189. #endif
  190.  
  191. #if defined(UseLibX)
  192. LIBX = -lx
  193. #else
  194. LIBX =
  195. #endif
  196.  
  197. #if defined(UseLibIntl)
  198. LIBINTL = -lintl
  199. #else
  200. LIBINTL =
  201. #endif
  202.  
  203. #if defined(MacIIArchitecture) || defined(UseLibPosix)
  204. LIBPOSIX = -lposix
  205. #else
  206. LIBPOSIX =
  207. #endif
  208.  
  209. #if defined(ATTArchitecture) || defined(UseLibDirent)
  210. LIBDIRENT = -ldirent
  211. #else
  212. LIBDIRENT =
  213. #endif
  214.  
  215. # The order here is significant.  Although nothing uses all of these, 
  216. # some platforms which use more than one do care about the order.
  217.  
  218. SYSLIBS = $(LIBPOSIX) $(LIBDIRENT) $(LIBTERMCAP) $(LIBCURSES) \
  219.     $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
  220.     $(LIBINET) $(LIBDIR) $(LIBX) $(LIBC_S) $(LIBSQNT)
  221.  
  222. /* Past here, nothing should need to be changed to compile on a different
  223. platform, unless you have a really weird architecture. */
  224.  
  225. #ifdef MyCC
  226. CC = MyCC
  227. #else
  228. # ifdef HasGCC
  229. CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
  230. # else
  231. CC = cc
  232. # endif
  233. #endif
  234.  
  235. #ifdef HESIOD
  236. # ifdef NeXTArchitecture
  237. HESLIB = -L/usr/athena/lib -lhesiod -lresolv
  238. # else
  239. HESLIB = -L/usr/athena/lib -lhesiod
  240. # endif
  241. /* it seems to me that the -I shouldn't be necessary, but there seems
  242. to be a bug in the Imake stuff, so here it is. */
  243. HESDEF = -DHESIOD -I/usr/athena/include
  244. #else
  245. HESLIB =
  246. HESDEF =
  247. #endif
  248.  
  249. /* This is encore specific, but I don't know what encore's #define is,
  250. and it shouldn't hurt to have it here, so here it is */
  251. PARALLEL=12                # Make the multi-max run fast.
  252.  
  253. #ifndef DestDir
  254. #define DestDir /usr/local
  255. #endif
  256.  
  257. DESTDIR = DestDir
  258. MANSUFFIX = 1
  259. #ifdef DestBin
  260. BINDIR = DestBin
  261. #else
  262. BINDIR = $(DESTDIR)/bin
  263. #endif
  264. #ifdef DestMan
  265. MANDIR = DestMan
  266. #else
  267. MANDIR = $(DESTDIR)/man/man$(MANSUFFIX)
  268. #endif
  269.  
  270. #ifndef MyCflags
  271. #define MyCflags
  272. #endif
  273.  
  274. #ifndef MyDefines
  275. #define MyDefines
  276. #endif
  277.  
  278. #ifndef MyIncludes
  279. #define MyIncludes
  280. #endif
  281.  
  282. #ifndef MyLibs
  283. #define MyLibs
  284. #endif
  285.  
  286. #ifdef CDebugFlags
  287. CDEBUGFLAGS = CDebugFlags
  288. #else
  289. CDEBUGFLAGS = -O
  290. #endif
  291.  
  292. #ifdef AOSArchitecture
  293. #define UStdc -U__STDC__
  294. #else
  295. #define UStdc
  296. #endif
  297.  
  298. #ifdef HostType
  299. HTDEF = Concat3(-DHOSTTYPE=\",HostType,\")
  300. #else
  301. HTDEF =
  302. #endif
  303.  
  304. DEFINES = $(CONFIGH) $(TCSHPATH) $(HESDEF) $(HTDEF) MyDefines MyCflags UStdc
  305. INCLUDES = -I. MyIncludes
  306. LDLIBS = MyLibs
  307.  
  308. SUF = o
  309. VERSION = 6.00
  310.  
  311. SHSRCS=    sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
  312.     sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
  313.     sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
  314.     sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
  315.     sh.decls.h glob.c glob.h mi.wait.h mi.termios.c
  316. SHOBJS=    sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
  317.     sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \
  318.     sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \
  319.     sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \
  320.     sh.set.${SUF} sh.time.${SUF} glob.${SUF} mi.termios.${SUF}
  321.  
  322. TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c
  323. TWOBJS=    tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF}
  324.  
  325. EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
  326.     ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
  327. EDOBJS=    ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
  328.     ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
  329.  
  330. TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
  331.     tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
  332.     tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
  333.     tc.who.c tc.h
  334. TCOBJS=    tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.disc.${SUF} \
  335.     tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
  336.     tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
  337.     tc.vers.${SUF} tc.who.${SUF} 
  338.  
  339. MISCF = Makefile Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
  340.     WishList config_f.h eight-bit.me glob.3 patchlevel.h \
  341.     pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
  342.     README.imake
  343. CONFSRCS=config/config.*
  344.  
  345.  
  346. SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
  347. OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
  348.  
  349. ALLSRCS= $(MISCF) $(SRCS)
  350.  
  351. all:: tcsh
  352.  
  353. ed.defns.h: ed.defns.c
  354.     @rm -f $@
  355.     @echo '/* Do not edit this file, make creates it. */' > $@
  356.     @echo '#ifndef _h_ed_defns' >> $@
  357.     @echo '#define _h_ed_defns' >> $@
  358.     egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
  359.     @echo '#endif /* _h_ed_defns */' >> $@
  360.  
  361. sh.err.h: sh.err.c
  362.     @rm -f $@
  363.     @echo '/* Do not edit this file, make creates it. */' > $@
  364.     @echo '#ifndef _h_sh_err' >> $@
  365.     @echo '#define _h_sh_err' >> $@
  366.     egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
  367.     @echo '#endif /* _h_sh_err */' >> $@
  368.  
  369. tc.const.h: tc.const.c
  370.     @rm -f $@
  371.     @echo '/* Do not edit this file, make creates it. */' > $@
  372.     $(CC) -E $(CFLAGS) tc.const.c | egrep 'Char STR' | \
  373.         sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
  374.         sort >> $@
  375.  
  376. $(OBJS): sh.err.h tc.const.h ed.defns.h
  377.  
  378. tar:
  379.     rm -f tcsh-${VERSION}.tar.Z
  380.     rm -rf tcsh-${VERSION} 
  381.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  382.     cp ${ALLSRCS} tcsh-${VERSION}
  383.     cp ${CONFSRCS} tcsh-${VERSION}/config
  384.     tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
  385.     rm -rf tcsh-${VERSION}
  386.  
  387. shar:
  388.     rm -f tcsh-*.shar
  389.     rm -rf tcsh-${VERSION} 
  390.     mkdir tcsh-${VERSION} tcsh-${VERSION}/config
  391.     cp ${ALLSRCS} tcsh-${VERSION}
  392.     cp ${CONFSRCS} tcsh-${VERSION}/config
  393.     MAKESHAR ${VERSION} tcsh-${VERSION}/[a-zA-Z]* \
  394.                 tcsh-${VERSION}/config/config.*
  395.     rm -rf tcsh-${VERSION}
  396.  
  397. world:
  398.     make clean ; make depend ; make tcsh ; make install
  399.  
  400. clean::
  401.     rm -f ed.defns.h sh.err.h tc.const.h
  402.  
  403. depend:: ed.defns.h sh.err.h tc.const.h $(SRCS)
  404.  
  405. NormalProgramTarget(tcsh, $(OBJS), ed.defns.h sh.err.h tc.const.h, \
  406.             /*LOCALLIBS*/, $(HESLIB) $(SYSLIBS))
  407.  
  408. InstallProgram(tcsh, $(BINDIR));
  409. InstallManPage(tcsh, $(MANDIR));
  410. DependTarget()
  411.